   static int OldSells = 0 ;
   static int OldBuys = 0 ;
   static int oldTotalOrderss = 0;
   static int OldBalance = 0;
   
int init()
  {
  oldTotalOrderss = OrdersTotal();
  OldBalance = AccountBalance();
  //----
  return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+

   
   
int start()
  {
   //----
  Print("=================================================================================");
  Print("=================================================================================");
  Print("=================================================================================");
  
   if(OrdersTotal()< 3){
     // open bye order
     openBuyOrder();
      // open sell order
     openSellOrder();
  }
  
   int Sells = 0 ;
   int Buys = 0 ;
   
   Print("oldTotalOrderss: "+oldTotalOrderss+" OrdersTotal:"+OrdersTotal());
   Print("AccountBalance: "+AccountBalance()+" OldBalance:"+OldBalance);
   Print("Dif :",(AccountBalance() - OldBalance ));
   if(AccountBalance() - OldBalance > 1){
     // open bye order
     int isBuyed = openBuyOrder();
      // open sell order
     int isSelled = openSellOrder();
     
     //if((isBuyed*isSelled) > 0){
         oldTotalOrderss = OrdersTotal();
         OldBalance = AccountBalance();
    // }
   }
   
   
   for(int i=0; i<OrdersTotal(); i++)   {//
         if (OrderSelect(i,SELECT_BY_POS)==true){//
            if(OrderType()==0){//
               // buy order
               Buys++;
            }else if(OrderType()==1){////
               // sell order
               Sells++;
            }//
         }//
   }//  end for loop
   
   //Print("OldSells:", OldSells , " OldBuys:",OldBuys);
   //Print("Current Buys:", Buys, " Current Sells:", Sells);
   
   OldSells = Sells;
   OldBuys = Buys;
   
   //----
   //----
   //----
   // sleep 20 sec
   Sleep(1*2*1000);
   
   //----
   return(0);
  }
//+------------------------------------------------------------------+
int openSellOrder(){
   RefreshRates();
   RefreshRates();
   int SellTicketNo=OrderSend(Symbol(),OP_SELLSTOP,0.2,Bid-0.00050,0,Ask+0.00305,Bid-0.00105,NULL,0,NULL,Red);
   Alert("Open Sell Order : ",SellTicketNo," Point............... : ",Point);
   Alert("GetLastError: "+GetLastError());
   return(SellTicketNo);
}
//+------------------------------------------------------------------+
int openBuyOrder(){
   RefreshRates();
   int BuyTicketNo=OrderSend(Symbol(), OP_BUYSTOP,0.2,Ask+0.00050,0,Bid-0.00305,Ask+0.00105,NULL,0,NULL,Green);
   Alert("Open Buy Order : ",BuyTicketNo," Ask : ",Bid);
   Alert("GetLastError: "+GetLastError());
   return(BuyTicketNo);
}